Learning HTML

September 17, 2002 - 0:0
Part 6 HTML Tip When using a background image for your document, keep in mind that your text will appear on top of the image. Background images should be a light color so that your text is readable.

Before you set the color properties of your document, keep in mind that not every user who visits your page will have their display colors set to the same as yours. Some users still work on computers that can only display 16 colors. Use caution when setting your document's properties if you are concerned about how the page will appear.

Previewing Your Work Once you have created your basic starting document and set your document properties it is a good idea to save your file. Since you are publishing for the Internet, you must save your files in a format that web browsers can interpret. A standard web page's file extension is usually ".htm". Some developers name their files with the extension ".html" but this format is not compliant on all platforms. In our examples we will use the .htm file extension. To save a file, in NotePad, follow these steps: 1. Locate and click on the menu called "File .." 2. Select the option under File Menu labeled "Save As ..."

3. In the "File Name" text box, type in the entire name of your file (including the extension .html).

i.e. index.html In NotePad you have to type the entire filename including its extension. If you do not type in the file's extension, NotePad will assume that you want your document to be a text document with the extension .txt.

Edit, Save & View Cycle As you continue to add to your web document(s), it is important to preview your work in a browser such as Netscape Navigator or Microsoft Internet Explorer.

To preview your work, open a web browser and do the following: In Netscape Navigator: 1. Click on the menu labeled "File ..." 2. Locate the menu option, "Open Page ... " 1. In the "Open Page" dialog box, click on the "Choose File ..." button and locate your web document. Ensure that the "Navigator" button option is clicked as you want to preview the work in the browser window.

2. Once you have chosen the file click on "Open" In Microsoft Internet Explorer: 1. Click on the menu labeled "File ..." 2. Locate the menu option, "Open ..." 3. In the "Open" dialog box, click on the "Browse ..." button and locate your web document. Click "OK" once you have selected your file.

Once you have opened and previewed your work in a web browser, you can continue working by adding to and editing the html file, saving the file with the changes and then viewing the changed file.

You will be more productive if you do not close your web browsers; simply minimize them and continue working. When you want to preview your work again: o save your html file's changes o switch to one of your browsers o hold down the

[SHIFT] key o in Netscape, click on the button labeled "RELOAD" o in IE click on the button labeled "REFRESH" The web browser will load the same document but with the new revisions. This process is the Edit, Save and View cycle.

Chapter 2 - Exercise 1 The goal of this exercise is to familiarize you with using the concepts discussed in Chapter 2.

Procedure 1. Start Notepad.

2. Create the following HTML page: XYZ Corporation BODY BGCOLOR="#FFFFFF"> This will set your documents background color to white. (Older browsers default to gray) 3. Save your file - call it index.htm. Save it in the C:\HTMLFILES\Exercises directory.

4. Preview your file. View your file in Navigator, IE and any other browser that you have installed and are using. Review Questions 1. What are the advantages of using a text editor instead of a full-blown word processor? 2. What does the TITLE element do? 3. What attribute controls the document's background color? 4. How are colors expressed as attribute values? 5. What does the BACKGROUND attribute do?